/*
 * author M.Chang
 *
 * Copyright 2008 Ph.Bonnet and M.Chang
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
#ifndef MODELGENERATOR_H_
#define MODELGENERATOR_H_

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>

#include "Mote.h"

typedef std::vector<std::string> vector_string;


class ModelGenerator
{
  public:
    ModelGenerator(const std::string model);
    ~ModelGenerator();

    void addMote(Mote&);
    bool getModel(std::string& model, std::map<std::string, vector_string>& route_map, std::map<std::string, vector_string>& neighbor_map);

    void setEpoch(unsigned int epoch);
    unsigned int getEpoch();
    void setEnergy(unsigned int energy);

  private:
    void replace(std::string& base_string, const std::string& source_string, const std::string& destination_string);

    std::string minizinc_string;
    std::string common_string;
    std::string mote_string;
    std::string filename_string;

    unsigned int epoch;
    unsigned int energy;
    std::vector<Mote> Mote_vector;
};




#endif /*MODELGENERATOR_H_*/
